1. Field of Technology
The present invention relates to a data processing apparatus and to a control method for the data processing apparatus, and relates more particularly to a memory writing process for the data processing apparatus.
2. Description of Related Art Data processing apparatuses such as printers and scanners are widely used today for personal use, business applications, and other purposes. A printer is used by way of example below as a data processing apparatus.
Modern printers have built-in firmware which is executed to control the printer. The firmware generally includes two programs: a boot program that executes a series of startup operations such as hardware initialization for starting printer operation, and a main program that runs after the boot program has finished the startup process and controls printer operation according to commands received from a host computer. The boot program and main program are stored in different sectors in flash ROM inside the printer. When the flash ROM is written to update one of the programs, for example, it can be written by sector and the boot program and main program can thus be updated separately.
A problem with this is that if writing the sector where the boot program is stored (the “boot sector”) fails, the printer cannot run the boot program to start operating, and the printer is thus rendered unable to operate. To avoid this problem, Japanese Unexamined Patent Appl. Pub. 2004-94628, for example, teaches a “double-boot” method that provides a plurality of selectively read boot sectors so that if writing the boot program to one boot sector fails, the printer can still startup by running a normal boot program stored in another boot sector.
This double-boot method always maintains at least two boot sectors in flash ROM, and provides for a loss of power while writing the boot program by assuring that at least one boot program can always run.
A problem with this double-boot method, however, is that it requires flash ROM with a large storage capacity in order to assure sufficient space for two boot sectors at all times in the flash ROM. Data processing apparatuses with limited flash ROM capacity are therefore unable to use this double-boot method, and more efficient use of the available flash ROM storage space is possible and desirable. Control of this double-boot method is also complicated by the need to manage version information tracking the boot sector write sequence so that the printer knows which of the two boot sectors stores the most recent version of the boot program.
The present invention is directed to solving this problem, and an object of the invention is to provide a data processing apparatus and a control method for a data processing apparatus that can start up by running a normal boot program the next time the power turns on in the event the power turns off while rewriting the boot program to flash ROM by temporarily providing a plurality of boot sectors instead of always maintaining a plurality of boot sectors in flash ROM.